//
//  EMSCharacterDataController.h
//  EVE Mac Suite
//
//  Created by Vadim Lozko on 3/28/09.
//  Copyright 2009 __Vadim__CompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@class EMSCharacterDataController;
@class EMSCharacterViewController;
@class EVEAPIImageDownloader;
@class EVEAPICharacterSheet;
@class EVEAPISkillQueue;
@class EVECDLearnedSkill;
@class EVECDCharacter;

@protocol DataControllerDelegate <NSObject>

-(void)characterDataController:(EMSCharacterDataController*)controller dataDidLoad:(BOOL)success;

@end

@interface EMSCharacterDataController : NSObject {
	id delegate;
	EMSCharacterViewController* charTabController;
	NSDictionary* characterInfo;
	EVECDCharacter* managedObjectCharacter;
	EVEAPIImageDownloader* imageDownloader;
	
	EVEAPICharacterSheet* characterSheet;
	EVEAPISkillQueue* skillQueue;
	NSDate* updateReferenceDate;
	int startSkillPoints;
	
	NSString* skillInTrainingName;
	NSString* timeToFinishTraining;
	NSString* trainingFinishDate;
	
	NSTimer* skillPointsUpdateTimer;
	NSTimer* nextUpdateUpdateTimer;
	EVECDLearnedSkill* currentSkillInTraining;
	
	NSDictionary* displayInfo;
	
	BOOL updating;
}

@property (assign) id <DataControllerDelegate> delegate;
@property (readonly) EVECDCharacter* managedObjectCharacter;
@property (retain) EVECDLearnedSkill* currentSkillInTraining;
@property (retain) NSString* skillInTrainingName;
@property (retain) NSString* timeToFinishTraining;
@property (retain) NSString* trainingFinishDate;
@property (retain) NSDictionary* displayInfo;
@property (assign, getter=isUpdating) BOOL updating;

-(id)initWithCharacterInfo:(NSDictionary*)charInfo;
-(NSDictionary*)characterInfo;
-(EVECDCharacter*)managedObjectCharacter;
-(NSString*)charName;
-(void)update;
-(void)forceUpdate;
-(void)invalidateTimers;
@end
